home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / program / ddj0897.zip / DYN401.ZIP / kernel / port / gctest.c < prev    next >
C/C++ Source or Header  |  1995-04-10  |  1KB  |  88 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6. /*
  7.  *
  8.  *    This source code is CONFIDENTIAL and
  9.  *    PROPRIETARY to Algorithms Corporation. Unauthorized
  10.  *    distribution, adaptation or use    may
  11.  *    be subject to civil and    criminal penalties.
  12.  *
  13.  *    Copyright (c) 1993 Algorithms Corporation
  14.  *    3020 Liberty Hills Drive
  15.  *    Franklin, TN  37064
  16.  *
  17.  *    ALL RIGHTS RESERVED.
  18.  *
  19.  *
  20.  *
  21.  */
  22.  
  23.  
  24. #include "generics.h"
  25.  
  26. #define    MEMU  \
  27.   printf("Memory usage %ld, %ld\n", gMaxMemUsed(Dynace), gCurMemUsed(Dynace)) 
  28.  
  29.  
  30. main(int argc, char *argv[])
  31. {
  32.     object    obj;
  33.     long    n, mba, cmu;
  34.  
  35.     InitClasses(&argc);
  36.  
  37.  
  38.     /*  The following line is used to turn on the automatic garbage
  39.         collector (un-comment after the first run) */
  40.  
  41. //    gSetMemoryBufferArea(Dynace, 50000L); 
  42.  
  43.  
  44.  
  45.     /*  Create enough new objects to fill up all the memory of a PC
  46.         (since no objects are ever explictly disposed).  */
  47.  
  48.     MEMU;
  49.     for (n=0 ; n++ != 125000L ; )  {
  50.         if (!(n % 1000L))
  51.             printf("%ld\n", n);
  52.         obj = vNew(DoubleFloat, 3.141);
  53.     }
  54.     gPrint(obj, stdoutStream);
  55.     gGC(Dynace);
  56.     MEMU;
  57.     gPrint(obj, stdoutStream);
  58.            
  59.     getch();
  60.     
  61.     return 0;
  62. }
  63.  
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70. /*
  71.  *
  72.  *    This source code is CONFIDENTIAL and
  73.  *    PROPRIETARY to Algorithms Corporation. Unauthorized
  74.  *    distribution, adaptation or use    may
  75.  *    be subject to civil and    criminal penalties.
  76.  *
  77.  *    Copyright (c) 1993 Algorithms Corporation
  78.  *    3020 Liberty Hills Drive
  79.  *    Franklin, TN  37064
  80.  *
  81.  *    ALL RIGHTS RESERVED.
  82.  *
  83.  *
  84.  *
  85.  */
  86.  
  87.  
  88.